let mongoose = require('mongoose')
let mongooseClient = require('../../util/mongoosedb').mongooseClient
let schema_room = new mongoose.Schema(
  {
    roomNo: 'string',
    desc: 'string',
    price:'number'
  });

let RoomDAO = mongooseClient.model('room', schema_room);


function save(obj) {
  let room = new RoomDAO(obj);
  room.save();

}


function query(filter,callback){
  RoomDAO.find({},(err, results)=>{
      callback(err,results)
  });
}

module.exports = {
  save: save,
  query:query
}

